﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Comun;

namespace Guada
{
    public partial class FrmDetalleHC : Form
    {
        private string Diagnostico;

        public FrmDetalleHC(string sDiagnostico)
        {
            InitializeComponent();
            Diagnostico = sDiagnostico;
        }

        private void FrmDetalleHC_Load(object sender, EventArgs e)
        {
            try
            {
                CargarDetalle();
            }
            catch
            {
                MessageBox.Show("Se produjo un Error!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }

        private void BtnCerrar_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void CargarDetalle()
        {
            FacProFacu.HistoriaClinica historial = new FacProFacu.HistoriaClinica();
            DataTable Dt = historial.GetDetalle(Diagnostico).Tables["DETALLEHC"];
            if (Dt.Rows.Count == 1)
            {
                lblsEspecialidad.Text = Dt.Rows[0]["ESPECIALIDAD"].ToString();
                lblsProf.Text = Dt.Rows[0]["APELLIDO"].ToString() + " " + Dt.Rows[0]["NOMBRE"].ToString();
                txtDetalle.Text = Dt.Rows[0]["DESCRIPCION"].ToString();
            }
        }
    }
}
